package com.bree.erp.report.vo;

import com.bree.erp.entity.ItemRequest;
import com.bree.erp.entity.MasterItem;
import com.bree.erp.entity.PartUnit;
import com.bree.erp.entity.Unit;

public class ItemRequestData {

	private ItemRequest itemRequest;
	private int count;
	
	public ItemRequestData(int count, ItemRequest itemRequest) {
		this.count = count;
		this.itemRequest = itemRequest;
	}
	
	public String getDescription() {
		PartUnit partUnit = itemRequest.getPartUnit();
		if(partUnit == null) {
			return null;
		}
		MasterItem masterItem = partUnit.getMasterItem();
		if(masterItem == null) {
			return null;
		}
		
		return masterItem.getDescription();
	}
	
	public double getQuantity() {
		return itemRequest.getQuantity();
	}
	
	public String getUnit() {

		PartUnit partUnit = itemRequest.getPartUnit();
		if(partUnit == null) {
			return null;
		}
		
		Unit unit = partUnit.getUnit();
		if(unit == null) {
			return null;
		}
		
		return unit.getCode();
		
	}
	
	public String getRemarks() {
		return itemRequest.getRemarks();
	}

	/**
	 * @return the count
	 */
	public int getCount() {
		return count;
	}
	
	
}
